# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM node:20.11.1

# Update package manager and install Git
# RUN apt-get update -y && apt-get install -y git

# Install Vite globally
RUN npm install -g vite

# Set the working directory
WORKDIR /home/user/svelte

# Copy package.json and package-lock.json for dependency installation
COPY svelte/package*.json ./

# Install front-end dependencies
# RUN npm install

# Copy the rest of the front-end code repository
COPY svelte /home/user/svelte

# Build the front-end application
RUN npm run build

# Expose the port of the front-end application
EXPOSE 5173

# Run the front-end application in preview mode
CMD ["npm", "run", "dev", "--", "--port", "5173", "--host", "0.0.0.0"]

